// 验证模块
const Joi = require('joi');
// 床模块
const {
    Bed
} = require('../../../model/Bed');

module.exports = async (req, res) => {
    const type = req.query.type;
    if (type) {
        // 查询床列表信息
        const beds = await Bed.find({
            type
        });
        // 响应
        return res.sendResult(beds || [], 200, '获取床列表信息成功');
    } else {
        return res.sendResult(null, 400, '床型ID不正确');
    }
};